package com.example.service;

import com.aspose.words.Document;
import org.springframework.stereotype.Service;

import java.io.InputStream;

@Service
public class WordToPdfService {

    public void convertWordToPdf(InputStream wordInputStream, String outputPdfPath) throws Exception {
        // 使用 Aspose.Words 将 Word 文档加载进来
        Document doc = new Document(wordInputStream);

        // 将文档保存为 PDF 格式
        doc.save(outputPdfPath);
    }
}
